def add(x):
    def fn1(y):
        def fn2(z):
            return x + y + z
        return fn2
    return fn1

print(add(4)(5)(6))